This notebook fosters the reproducibility of the following paper:
If you want to compute the same metrics with you own data, we redirect you towards our generic content analysis GitHub https://github.com/vincentpmartin/generic_content_analysis
Welcome to this online coding environment ! You are currently running a Jupyter notebook that we hope to be usefull for content analysis of questionnaires.
Each cell can be ran individually (pressing the "Play" ▶ button or pressing CTRL+ENTER in the each cell). In order to make everything run smoothly, it is strongly recommended to run them in order.
RECOMMANDED: You can also run all the cells at the same time : "Run" → "Run All Cells".
At the end of the execution, you will have the opportunity to save all yours results in an HTML file, executing "File" → "Save and Export Notebook as" → "HTML"
If you have chosen to run every cell individually, please begin by running the following cell that imports all the required package for our code to work correctly ↓
| Category | Subcategory | Ab | Symptom | MEQ | MCTQ | CSM | rMEQ | CQ | DTQ | CTQ | CIRENS | CCQ | CTI | CAPS TAQ | SCRAM | SIC | SRQ | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | Circadian phase | Evening time | S01 | Bedtime (phase) | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
| 1 | Circadian phase | Morning time | S02 | Rise time (phase) | 1 | 0 | 1 | 0 | 2 | 1 | 1 | 0 | 2 | 0 | 1 | 0 | 0 | 0 |
| 2 | Circadian phase | Evening time | S03 | Sleep time (phase) | 2 | 1 | 2 | 2 | 0 | 2 | 1 | 0 | 0 | 0 | 0 | 2 | 0 | 0 |
| 3 | Circadian phase | Morning time | S04 | Awake time (phase) | 0 | 1 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 4 | Circadian phase | Daytime | S05 | Social activity (phase) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
| Category | Subcategory | Ab | Symptom | CAPS TAQ | CTQ | CQ | MEQ | CSM | MCTQ | CCQ | DTQ | CTI | SCRAM | rMEQ | SRQ | SIC | CIRENS | sum_symptoms | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 8 | Circadian phase | Daytime | S09 | Peak feeling (phase) | 1 | 1 | 1 | 1 | 2 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 8 |
| 1 | Circadian phase | Morning time | S02 | Rise time (phase) | 1 | 1 | 2 | 1 | 1 | 0 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
| 2 | Circadian phase | Evening time | S03 | Sleep time (phase) | 0 | 1 | 0 | 2 | 2 | 1 | 0 | 2 | 0 | 2 | 2 | 0 | 0 | 0 | 7 |
| 39 | Circadian complaints | Evening time | S40 | Evening sleepiness (complaint) | 0 | 0 | 2 | 2 | 2 | 0 | 0 | 2 | 2 | 2 | 2 | 0 | 0 | 0 | 7 |
| 11 | Circadian phase | Self-evaluation | S12 | Self-evaluation (phase) | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 2 | 0 | 6 |
In a first step, we analyse the frequency of the symptoms.
The figure has been save in the online folder (📁 symbol on the left) under the name figure1_histogram_1.pdf.
You can change the name and the format of the file changing the name in the #fig.write_image() function.
⚠️ If you need it, save the figure on your local computer : these online file will be deleted as soon as you quit this page!
The figure has been save in the online folder (📁 symbol on the left) under the name figure2_histogram_2.pdf.
You can change the name and the format of the file changing the name in the #fig.write_image() function.
⚠️ If you need it, save the figure on your local computer : these online file will be deleted as soon as you quit this page!
| Specific symptoms | Compound symptoms | Total | |
|---|---|---|---|
| CAPS TAQ | 12 | 4 | 16 |
| CTQ | 9 | 5 | 14 |
| CQ | 8 | 5 | 13 |
| MEQ | 9 | 3 | 12 |
| CSM | 6 | 6 | 12 |
| MCTQ | 11 | 0 | 11 |
| CCQ | 9 | 1 | 10 |
| DTQ | 4 | 4 | 8 |
| CTI | 3 | 5 | 8 |
| SCRAM | 4 | 2 | 6 |
| rMEQ | 3 | 2 | 5 |
| SRQ | 4 | 0 | 4 |
| SIC | 0 | 3 | 3 |
| CIRENS | 1 | 0 | 1 |
The table has been save in the online folder (📁 symbol on the left) under the name table1_symptoms_per_questionnaire.xlsx.
You can change the name and the format of the file changing the name in the sympt_per_questionnaire.to_excel() function.
⚠️ If you need it, save the excel file on your local computer : these online file will be deleted as soon as you quit this page!
| CAPS TAQ | CTQ | CQ | MEQ | CSM | MCTQ | CCQ | DTQ | CTI | SCRAM | rMEQ | SRQ | SIC | CIRENS | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Circadian phase | 8 | 3 | 5 | 9 | 8 | 3 | 5 | 4 | 0 | 4 | 3 | 0 | 1 | 1 |
| Circadian amplitude&stability | 8 | 7 | 5 | 1 | 0 | 0 | 4 | 0 | 4 | 0 | 0 | 0 | 1 | 0 |
| Circadian timing | 0 | 0 | 0 | 0 | 0 | 5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Circadian regularity | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 4 | 0 | 0 |
| Circadian complaints | 0 | 4 | 3 | 2 | 4 | 3 | 1 | 4 | 4 | 1 | 2 | 0 | 1 | 0 |
The table has been save in the online folder (📁 symbol on the left) under the name table2_categorie_per_questionnaire.xlsx.
You can change the name and the format of the file changing the name in the cat_per_questionnaire.T.to_excel() function.
⚠️ If you need it, save the excel file on your local computer : these online file will be deleted as soon as you quit this page!
(i.e. same thing as before, but normalized by questionnaire (sum across lines equals 1)).
Figure 3 has been save in the online folder (📁 symbol on the left) under the name figure3_heatmap.pdf. You can change the name and the format of the file changing the name in the #fig.write_image() function.
⚠️ If you need it, save the figure on your local computer : these online file will be deleted as soon as you quit this page!
The figure has been save in the online folder (📁 symbol on the left) under the name figure4_radial.pdf. You can change the name and the format of the file changing the name in the #fig.write_image() function.
⚠️ If you need it, save the figure on your local computer : these online file will be deleted as soon as you quit this page!
In order to estimate the overlap between the symptoms measured by the questionnes, calculate the Jaccard index, which is defined as the number of symmtoms that are measured by both questionnaires, divided by the number of unique symptoms measured both questionnaires.
First, we compute the Jaccard index for each pair of questionnaires and plot it using a heatmap.
| CAPS TAQ | CTQ | CQ | MEQ | CSM | MCTQ | CCQ | DTQ | CTI | SCRAM | rMEQ | SRQ | SIC | CIRENS | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CAPS TAQ | 1.000000 | 0.304348 | 0.318182 | 0.333333 | 0.217391 | 0.038462 | 0.368421 | 0.090909 | 0.142857 | 0.047619 | 0.050000 | 0.000000 | 0.000000 | 0.062500 |
| CTQ | 0.304348 | 1.000000 | 0.350000 | 0.181818 | 0.181818 | 0.136364 | 0.200000 | 0.222222 | 0.294118 | 0.052632 | 0.117647 | 0.000000 | 0.062500 | 0.071429 |
| CQ | 0.318182 | 0.350000 | 1.000000 | 0.388889 | 0.315789 | 0.000000 | 0.642857 | 0.166667 | 0.312500 | 0.117647 | 0.200000 | 0.000000 | 0.000000 | 0.076923 |
| MEQ | 0.333333 | 0.181818 | 0.388889 | 1.000000 | 0.600000 | 0.095238 | 0.294118 | 0.333333 | 0.176471 | 0.285714 | 0.416667 | 0.000000 | 0.071429 | 0.083333 |
| CSM | 0.217391 | 0.181818 | 0.315789 | 0.600000 | 1.000000 | 0.210526 | 0.222222 | 0.538462 | 0.176471 | 0.285714 | 0.416667 | 0.000000 | 0.071429 | 0.083333 |
| MCTQ | 0.038462 | 0.136364 | 0.000000 | 0.095238 | 0.210526 | 1.000000 | 0.000000 | 0.266667 | 0.055556 | 0.133333 | 0.066667 | 0.000000 | 0.000000 | 0.000000 |
| CCQ | 0.368421 | 0.200000 | 0.642857 | 0.294118 | 0.222222 | 0.000000 | 1.000000 | 0.058824 | 0.200000 | 0.066667 | 0.153846 | 0.000000 | 0.000000 | 0.100000 |
| DTQ | 0.090909 | 0.222222 | 0.166667 | 0.333333 | 0.538462 | 0.266667 | 0.058824 | 1.000000 | 0.142857 | 0.272727 | 0.300000 | 0.000000 | 0.100000 | 0.000000 |
| CTI | 0.142857 | 0.294118 | 0.312500 | 0.176471 | 0.176471 | 0.055556 | 0.200000 | 0.142857 | 1.000000 | 0.076923 | 0.181818 | 0.000000 | 0.100000 | 0.000000 |
| SCRAM | 0.047619 | 0.052632 | 0.117647 | 0.285714 | 0.285714 | 0.133333 | 0.066667 | 0.272727 | 0.076923 | 1.000000 | 0.375000 | 0.111111 | 0.125000 | 0.000000 |
| rMEQ | 0.050000 | 0.117647 | 0.200000 | 0.416667 | 0.416667 | 0.066667 | 0.153846 | 0.300000 | 0.181818 | 0.375000 | 1.000000 | 0.000000 | 0.142857 | 0.200000 |
| SRQ | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.111111 | 0.000000 | 1.000000 | 0.000000 | 0.000000 |
| SIC | 0.000000 | 0.062500 | 0.000000 | 0.071429 | 0.071429 | 0.000000 | 0.000000 | 0.100000 | 0.100000 | 0.125000 | 0.142857 | 0.000000 | 1.000000 | 0.000000 |
| CIRENS | 0.062500 | 0.071429 | 0.076923 | 0.083333 | 0.083333 | 0.000000 | 0.100000 | 0.000000 | 0.000000 | 0.000000 | 0.200000 | 0.000000 | 0.000000 | 1.000000 |
Table 3 has been save in the online folder (📁 symbol on the left) under the name table3_jaccard_pairs.xlsx.
You can change the name and the format of the file changing the name in the jaccard_table.to_excel() function.
⚠️ If you need it, save the excel file on your local computer : these online file will be deleted as soon as you quit this page!
The figure has been save in the online folder (📁 symbol on the left) under the name figure5_heatmap_jaccard.pdf.
You can change the name and the format of the file changing the name in the #fig.write_image() function.
⚠️ If you want it, save the figure on your local computer : these online file will be deleted as soon as you quit this page!
Then, we compute the average of Jaccard index for each questionnaire with other questionnaires (excluding the references).
| Avg. Jaccard Index | |
|---|---|
| CAPS TAQ | 0.151848 |
| CTQ | 0.167300 |
| CQ | 0.222266 |
| MEQ | 0.250796 |
| CSM | 0.255371 |
| MCTQ | 0.077139 |
| CCQ | 0.177458 |
| DTQ | 0.191744 |
| CTI | 0.143044 |
| SCRAM | 0.150007 |
| rMEQ | 0.201628 |
| SRQ | 0.008547 |
| SIC | 0.051786 |
| CIRENS | 0.052117 |
Average Jaccard index (wo references): 0.15007 (sd: 0.0767)
Table 4 has been save in the online folder (📁 symbol on the left) under the name table4_jaccard_average_questionnaires.xlsx.
You can change the name and the format of the file changing the name in the jaccard.to_excel() function.
⚠️ If you need it, save the excel file on your local computer : these online file will be deleted as soon as you quit this page!
| Avg. Jaccard Index | Specific symptoms | Compound symptoms | Total | |
|---|---|---|---|---|
| CAPS TAQ | 0.151848 | 12 | 4 | 16 |
| CTQ | 0.167300 | 9 | 5 | 14 |
| CQ | 0.222266 | 8 | 5 | 13 |
| MEQ | 0.250796 | 9 | 3 | 12 |
| CSM | 0.255371 | 6 | 6 | 12 |
| MCTQ | 0.077139 | 11 | 0 | 11 |
| CCQ | 0.177458 | 9 | 1 | 10 |
| DTQ | 0.191744 | 4 | 4 | 8 |
| CTI | 0.143044 | 3 | 5 | 8 |
| SCRAM | 0.150007 | 4 | 2 | 6 |
| rMEQ | 0.201628 | 3 | 2 | 5 |
| SRQ | 0.008547 | 4 | 0 | 4 |
| SIC | 0.051786 | 0 | 3 | 3 |
| CIRENS | 0.052117 | 1 | 0 | 1 |
Correlation between Jaccard Index and number of specific symptoms: SignificanceResult(statistic=0.34851905254334287, pvalue=0.222007239925357) Correlation between Jaccard Index and number of compound symptoms: SignificanceResult(statistic=0.5695643285911823, pvalue=0.0334921506582554) Correlation between Jaccard Index and total number of symptoms: SignificanceResult(statistic=0.5792965594550208, pvalue=0.029933781366618964)
Computing the same metric (average of average) for each category of questionnaires.
c:\Users\Vincent\anaconda3\lib\site-packages\numpy\core\fromnumeric.py:3440: RuntimeWarning: Mean of empty slice. c:\Users\Vincent\anaconda3\lib\site-packages\numpy\core\_methods.py:189: RuntimeWarning: invalid value encountered in double_scalars
| Avg. Jaccard Index | |
|---|---|
| Circadian phase | 0.254176 |
| Circadian amplitude&stability | 0.223167 |
| Circadian timing | NaN |
| Circadian regularity | 0.250000 |
| Circadian complaints | 0.257316 |
Table 5 has been save in the online folder (📁 symbol on the left) under the name table5_jaccard_categories.xlsx.
You can change the name and the format of the file changing the name in the res.to_excel() function.
⚠️ If you need it, save the excel file on your local computer : these online file will be deleted as soon as you quit this page!
The figure has been save in the online folder (📁 symbol on the left) under the name figure6_sunburst_plot.pdf.
You can change the name and the format of the file changing the name in the #fig.write_image() function.
⚠️ If you want it, save the figure on your local computer : these online file will be deleted as soon as you quit this page!
The figure has been save in the online folder (📁 symbol on the left) under the name figure7_sunburst_plot.pdf.
You can change the name and the format of the file changing the name in the #fig.write_image() function.
⚠️ If you want it, save the figure on your local computer : these online file will be deleted as soon as you quit this page!
You have reached the end of this notebook. If you want to save the whole page, you can download it to html with dynamic figures:
- "File" → "Save and Export Notebook as" → "HTML"